package poker.util;

import java.util.ArrayList;

import poker.entities.Card;
import poker.entities.Hand;

public class HandsMerger {
	
	/**
	 * 		merge
	 * @param hand1
	 * @param hand2
	 * @return a merged hand with the cards of the first and second hand.
	 */
	public static Hand merge(Hand hand1, Hand hand2){
		ArrayList<Card> mergedHandCards = new ArrayList<Card>();
		mergedHandCards.addAll(hand1.getCards());
		mergedHandCards.addAll(hand2.getCards());
		Hand h = new Hand(mergedHandCards);
		h.sortDescending();
		return h;
	}

}
